package com.vetalitet.components;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.widget.Button;

public class MenuButton extends Button {

    private Path path;
    private Paint paint;

    private int width;
    private int height;

    public MenuButton(Context context) {
        super(context);
        init();
    }

    public MenuButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        width = this.getWidth();
        height = getHeight();
        path = new Path();
        paint = new Paint();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        drawCircle(canvas);
    }

    private void drawCircle(Canvas canvas) {
        paint.setAntiAlias(true);
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(Color.parseColor("#00FF00"));
        path.addCircle(width / 2, height / 2, width / 2, Path.Direction.CCW);
        canvas.drawPath(path, paint);
    }

}
